home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / misc / xref_v1.1.lha / XRef / Tools / lib / calctextwidth.c next >
Encoding:
C/C++ Source or Header  |  1994-09-22  |  533 b   |  35 lines

  1. /*
  2. ** $PROJECT: xrefsupport.lib
  3. **
  4. ** $VER: calctextwidth.c 1.1 (10.09.94)
  5. **
  6. ** by
  7. **
  8. ** Stefan Ruppert , Windthorststraße 5 , 65439 Flörsheim , GERMANY
  9. **
  10. ** (C) Copyright 1994
  11. ** All Rights Reserved !
  12. **
  13. ** $HISTORY:
  14. **
  15. ** 10.09.94 : 001.001 :  initial
  16. */
  17.  
  18. #include "/source/Def.h"
  19.  
  20. UWORD calctextwidth(struct RastPort *rp,STRPTR *textarray)
  21. {
  22.    UWORD max = 0;
  23.    UWORD x;
  24.  
  25.    while(*textarray)
  26.    {
  27.       if((x = TextLength(rp,*textarray,strlen(*textarray))) > max)
  28.          max = x;
  29.       textarray++;
  30.    }
  31.  
  32.    return(max);
  33. }
  34.  
  35.